﻿<UserControl x:Class="My.CodePlex.TFSExplorer.PendingChangesControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:My.CodePlex.TFSExplorer">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal">
            <Button Height="25" Width="90" Margin="0,5,5,0" Click="CheckinClick" VerticalAlignment="Top">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <Image Height="16" Width="16" Margin="0,0,5,0" Source="pack://application:,,,/My.CodePlex.TFSExplorer;component/Images/Checkin.png"/>
                        <TextBlock Text="Checkin" />
                    </StackPanel>
                </Button.Content>
            </Button>
            <Button Height="25" Width="90" Margin="0,5,5,0" Click="ShelveClick" VerticalAlignment="Top">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <Image Height="16" Width="16" Margin="0,0,5,0" Source="pack://application:,,,/My.CodePlex.TFSExplorer;component/Images/Shelve.png"/>
                        <TextBlock Text="Shelve" />
                    </StackPanel>
                </Button.Content>
            </Button>
            <Button Height="25" Width="120" Margin="0,5,5,0" Click="UndoClick" VerticalAlignment="Top">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <Image Height="16" Width="16" Margin="0,0,5,0" Source="pack://application:,,,/My.CodePlex.TFSExplorer;component/Images/Undo.png"/>
                        <TextBlock Text="Undo Checkout" />
                    </StackPanel>
                </Button.Content>
            </Button>
            <Button Height="25" Width="90" Margin="0,5,5,0" Click="RefreshClick" VerticalAlignment="Top">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <Image Height="16" Width="16" Margin="0,0,5,0" Source="pack://application:,,,/My.CodePlex.TFSExplorer;component/Images/Refresh.png"/>
                        <TextBlock Text="Refresh" />
                    </StackPanel>
                </Button.Content>
            </Button>
            <TextBox x:Name="ShelvesetName" Margin="0,5" Width="300" 
                    IsUndoEnabled="True" TextWrapping="Wrap"
                    AcceptsReturn="True" VerticalScrollBarVisibility="Visible"
                    Text="[Add Checkin or Shelveset Name...]" />
            <TextBox x:Name="ShelvesetComment" Margin="5,5" Width="300" 
                    IsUndoEnabled="True" TextWrapping="Wrap"
                    AcceptsReturn="True" VerticalScrollBarVisibility="Visible"
                    Text="[Add Checkin or Shelveset Comment...]" />
        </StackPanel>
        
        <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" Width="Auto" Height="3" />

        <ListView Grid.Row="2" Name="PendingChangesView"
                  local:ListViewSorter.CustomListViewSorter="My.CodePlex.TFSExplorer.PendingChangesItemComparer">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="Auto" Header="Filename">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid Margin="6,0,6,0" >
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width ="15" />
                                        <ColumnDefinition Width ="20" />
                                        <ColumnDefinition Width ="*" />
                                    </Grid.ColumnDefinitions>
                                    <CheckBox VerticalAlignment ="Center" IsChecked="{Binding IsSelected}"/>
                                    <Image Grid.Column="1" VerticalAlignment ="Center" Width="16" Height="16" Stretch="None" Source="{Binding ImgSource}" />
                                    <TextBlock Text="{Binding FileName}" Grid.Column="2" TextTrimming="CharacterEllipsis" VerticalAlignment ="Center" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="Auto" Header="Change type" DisplayMemberBinding="{Binding ChangeTypeName}"  />
                    <GridViewColumn Width="Auto" Header="Creation date" DisplayMemberBinding="{Binding CreationDate}"  />
                    <GridViewColumn Width="Auto" Header="File path" DisplayMemberBinding="{Binding LocalItem}"  />
                </GridView>
            </ListView.View>
        </ListView>
        
    </Grid>
</UserControl>
